
<%--
  Created by IntelliJ IDEA.
  User: lenovo
  Date: 2023-12-22
  Time: 11:24
  To change this template use File | Settings | File Templates.
--%>
<!DOCTYPE html>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ page isELIgnored="false" %>
<!-- 设置页面为Chain -->
<html lang="ch">
<head>
    <title>订单详情</title>
    <!-- 设置地址栏主题背景颜色 -->
    <meta name="theme-color" content="#000000">
    <!-- 页面描述 -->
    <meta name="description" content="页面描述信息">
    <!-- 移动端显示 -->
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <script src="${pageContext.request.contextPath}/other/component/jquery.min.js"></script>
    <script src="${pageContext.request.contextPath}/other/scripts/reception_desk/order.js"></script>
    <script src="${pageContext.request.contextPath}/other/scripts/reception_desk/orders_details.js"></script>
    <script src="${pageContext.request.contextPath}/other/request/background/gaud.js"></script>
    <script src="${pageContext.request.contextPath}/other/scripts/reception_desk/address_img.js"></script>
    <script src="${pageContext.request.contextPath}/other/resource/address_util.js"></script>
    <!-- 页面Logo -->
    <link rel="shortcut icon" href="http://localhost:8083/resource_packs/images/logo.png">
    <link href="${pageContext.request.contextPath}/other/style/reception_desk/ordersDetails.css" rel="stylesheet"
          type="text/css"/>
    <link href="${pageContext.request.contextPath}/other/style/reception_desk/order.css" rel="stylesheet"
          type="text/css"/>
</head>
<body>
<jsp:useBean id="orders" scope="request" type="java.util.List"/>
<jsp:useBean id="id" scope="request" type="java.lang.Integer"/>
<div class="content" information-id="${id}" account-id="${accountId}" name="${name}" state="${state}">
    <div class="personal-information">
        <div class="uc-box uc-main-box">
            <div class="uc-content-box">
                <div class="box-hd">
                    <h3 class="title">
                        订单详情
                        <small>请谨防钓鱼链接或诈骗电话，<a href="">请了解更多></a></small>
                    </h3>
                    <c:forEach var="item" items="${orders}" varStatus="orders">
                        <div class="more-order clearfix">
                            <b class="order-number">订单号：${fn:substring(item.ordersId,2 ,20)}</b>
                            <span class="more-order-right">
                        </span>
                        </div>
                        <div class="order-substance">
                            <c:forEach var="numberProducts" items="${item.numberProducts}"
                                       varStatus="numberProductsStatus">
                                <c:if test="${fn:replace((fn:length(item.numberProducts)+1)/2, '.0','' )>1}">
                                    <c:forEach var="commodityList" items="${item.commodityList}"
                                               begin="${fn:replace((numberProductsStatus.index+numberProducts)/numberProducts,'.0' ,'' )+1}"
                                               end="${fn:replace((numberProductsStatus.index+numberProducts)/numberProducts,'.0' ,'' )+1}">
                                        <div class="order-substance-div">
                                            <div>
                                                <c:forEach var="commodityImages"
                                                           items="${commodityList.commodityImages}">
                                                    <img commodity-id="${commodityList.commodityId}"
                                                         class="order-substance-img"
                                                         src="http://localhost:8083/resource_packs/images/${commodityImages} "
                                                         alt="商品图片" width="110px">
                                                </c:forEach>
                                            </div>
                                            <div class="order-substance-span">
                                                <span>
                                                    ${commodityList.commodityName}
                                                    <c:forEach var="commoditySpecification" items="${commodityList.commoditySpecification}"
                                                             begin="0" end="0">
                                                      ${commoditySpecification.specificationName}
                                                    </c:forEach>
                                                      <br>
                                                    <c:forEach var="commodityInsurances" items="${commodityList.commodityInsurances}"
                                                               begin="0" end="0">
                                                        ${commodityInsurances.insuranceTitle}
                                                    </c:forEach>
                                                    [交易快照]
                                                </span>
                                            </div>
                                            <div class="more-order-price">
                                                    ${commodityList.commodityPrice}元
                                                x ${numberProducts}
                                            </div>
                                        </div>
                                    </c:forEach>
                                </c:if>
                                <c:if test="${fn:replace((fn:length(item.numberProducts)+1)/2, '.0','' )==1}">
                                    <c:forEach var="commodityList" items="${item.commodityList}"
                                               begin="${fn:replace((numberProductsStatus.index+numberProducts)/numberProducts,'.0' ,'' )-1}"
                                               end="${fn:replace((numberProductsStatus.index+numberProducts)/numberProducts,'.0' ,'' )-1}">
                                        <div class="order-substance-div">
                                            <div>
                                                <c:forEach var="commodityImages"
                                                           items="${commodityList.commodityImages}">
                                                    <img commodity-id="${commodityList.commodityId}"
                                                         class="order-substance-img"
                                                         src="http://localhost:8083/resource_packs/images/${commodityImages} "
                                                         alt="商品图片" width="110px">
                                                </c:forEach>
                                            </div>
                                            <div class="order-substance-span">
                                <span>
                                ${commodityList.commodityName}
                              <c:forEach var="commoditySpecification" items="${commodityList.commoditySpecification}"
                                         begin="0" end="0">
                                  ${commoditySpecification.specificationName}
                              </c:forEach>
                                  <br>
                                <c:forEach var="commodityInsurances" items="${commodityList.commodityInsurances}"
                                           begin="0" end="0">
                                    ${commodityInsurances.insuranceTitle}
                                </c:forEach>
                          [交易快照]
                            </span>
                                            </div>
                                            <div class="more-order-price">
                                                    ${commodityList.commodityPrice}元
                                                x ${numberProducts}
                                            </div>
                                        </div>
                                    </c:forEach>
                                </c:if>
                            </c:forEach>
                            <div class="order-substance-div-address">
                                <div class="order-substance-address">
                                    <h3 class="titles">收货信息</h3>
                                    <p>姓   名：${item.address.addressName}</p>
                                    <p>联系电话：${item.address.addressPhone}</p>
                                    <p>收货地址：${item.address.addressProvince} ${item.address.addressCity} ${item.address.addressDistrict} ${item.address.fullAddress}</p>
                                </div>
                                <div class="order-substance-address-sky"></div>
                                <div class="order-substance-button">
                                    <button logistics-companies-name="${item.logisticsCompanies.logisticsCompaniesName}" status="${item.ordersStatus}" station-longitude="${item.logisticsStation.logisticsStationLongitude}"
                                            station-latitude="${item.logisticsStation.logisticsStationLatitude}"
                                            station-deliveryman="${item.logisticsStation.logisticsStationDeliveryman}"
                                            logistics-station-province="${item.logisticsStation.logisticsStationProvince}"
                                            logistics-station-city="${item.logisticsStation.logisticsStationCity}"
                                            logistics-station-district="${item.logisticsStation.logisticsStationDistrict}"
                                            logistics-station-name="${item.logisticsStation.logisticsStationName}"
                                            warehouse-name="${item.warehouse.warehouseName}"
                                            warehouse-latitude="${item.warehouse.warehouseLatitude}"
                                            warehouse-longitude="${item.warehouse.warehouseLongitude}"
                                            address-name="${item.address.addressName}"
                                            address-phone="${item.address.addressPhone}"
                                            address-province="${item.address.addressProvince}"
                                            address-city="${item.address.addressCity}"
                                            address-district="${item.address.addressDistrict}"
                                            address-longitude="${item.address.longitude}"
                                            address-latitude="${item.address.latitude}"
                                            address-full-address="${item.address.fullAddress}"
                                            class="look-logistics">查看物流消息</button>
                                </div>
                            </div>
                            <div class="payment-methods">
                                <h3>支付方式</h3>
                                <h4>支付方式：<c:if test="${item.paymentMethods == 0}">微信支付APP</c:if><c:if test="${item.paymentMethods == 1}">支付宝支付APP</c:if><c:if test="${item.paymentMethods == 2}">银行卡支付</c:if></h4>
                            </div>
                            <div class="order-substance-details">
                                <p>商品总价：<span class="commodity-price">${item.paymentPrice}元</span></p>
                                <p>促销优惠：<span>-0.00元</span></p>
                                <p>运费：<span class="freight">${item.freight}元</span></p>
                                <p>实付金额：
                                    <c:forEach var="commodityList" items="${item.commodityList}" begin="0" end="0">
                                        <span class="out-pocket-amount" discount="${commodityList.commodityDiscount}"></span><span>元</span>
                                    </c:forEach></p>
                            </div>
                        </div>
                    </c:forEach>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
</html>
